package com.microservice.base.mapper.hikcommon;


import com.microservice.base.dto.*;
import com.microservice.base.entity.SysTreeview;
import com.microservice.base.entity.TreeviewUser;
import com.microservice.base.entity.User;
import com.microservice.base.mapper.BaseMP;
import com.microservice.base.vo.searchVo.TreeviewUserSearchVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 通用树用户关系表
 *
 * @author zq
 * @email 513973172@qq.com
 * @date 2019-01-31 11:18:49
 */
public interface TreeviewUserMP extends BaseMP<TreeviewUser> {

    TreeviewPositionDto getViewByUserAndTreeviewId(@Param("userId") String userId, @Param("treeviewId") String treeviewId);

    List<TreeviewTeacherDto> queryTeacherDto(TreeviewUserSearchVo searchVo);

    Integer getTeacherCount(TreeviewUserSearchVo searchVo);

    List<TreeviewStudentDto> queryStudentDto(TreeviewUserSearchVo searchVo);

    Integer getStudentCount(TreeviewUserSearchVo searchVo);

    List<TreeviewPositionDto> getTreeviewPositionByUserId(String userId);

    void deleteByUserId(String userId);

    void deleteByTreeviewId(String id);

    void deleteBatchByTreeviewId(String[] ids);

    TreeviewUser getByUserAndTreeviewId(@Param("userId") String userId, @Param("classId") String classId);

    List<String> getPositionIdsByUserId(String id);

    List<TreeviewTeacherDto> getTreeviewTeacherByUserId(String userId);

    List<TreeviewStudentDto> getTreeviewStudentByUserId(String userId);

    void deleteBatchByUserId(String[] strings);

    List<Map<String, Object>> sql(String classStudentSql);

    void updateUserimportancePosition(String userId);

    List<TreeviewTeacherDto> queryNotInTeacherDto(TreeviewUserSearchVo searchVo);

    Integer getNotInTeacherCount(TreeviewUserSearchVo searchVo);

    TreeviewUser getTreeviewPositionById(String id);

    TreeviewStudentDto getgcClassByStudentId(String id);

    @Override
    void save(TreeviewUser treeviewUser);

    @Override
    int update(TreeviewUser treeviewUser);

    @Override
    void delete(String id);

    List<Map<String, Object>> getTreeviewUserByIds(@Param("treeviewIds") String[] treeviewIds, @Param("updateTime") String updateTime, @Param("schoolCode") String schoolCode);

    List<TreeviewUser> queryByPlaceId(@Param("placeId") String placeId, @Param("tvType") String tvType, @Param("schoolCode") String schoolCode);

    TreeviewStudentDto getViewByUserAndTvType(@Param("userId") String userId, @Param("tvType") String s, @Param("tvParentid") String tvParentid);

    List<TreeviewPositionDto> queryByPositionId(TreeviewUserSearchVo searchVo);

    int queryCountByPositionId(TreeviewUserSearchVo searchVo);

    List<TreeviewStudentDto> getStudentClassByUserId(String[] userId);

    int getcountbyclassids(String[] ids);

    List<Map<String, Object>> queryClassCountBySchoolCode(String schoolCode);

    int getCountByTreeviewIds(@Param("treeviewIds") List<String> treeviewIds);

    void updateImportancePosition(String treeviewUserId);

    TreeviewPositionDto getTreeviewByUserIdAndTreeviewId(@Param("userId") String userId, @Param("treeviewId") String treeviewId);

    List<TreeviewStudentDto> getStudentClassesByUserId(String userId);

    List<TreeviewUserDto> queryUserDto(TreeviewUserSearchVo treeviewUserSearchVo);

    TreeviewStudentDto getgcClassByUserId(String userId);

    List<TreeviewTeacherDto> getTreeviewTeacherByTreeviewId(@Param("treeviewId") String treeviewId,@Param("positionCode")String positionCode);

    List<SysTreeview> getTreeviewByUserId(@Param("userId") String userId, @Param("tvTypes")String[] tvType);

    List<User> getUserByAuthority(@Param("schoolCode")String schoolCode, @Param("authority")String authority, @Param("userTypes")String[] userType, @Param("classIds")String[] classIds, @Param("gradeIds")String[] gradeIds);

    List<TreeviewUserDto> getTreeviewByPositionCodes(@Param("schoolCode")String schoolCode,  @Param("positionCodes")String[] positionCodes,  @Param("userType")String userType);

    List<TreeviewStudentDto> queryNotInStudentDto(TreeviewUserSearchVo searchVo);

    Integer getNotInStudentCount(TreeviewUserSearchVo searchVo);

    TreeviewTeacherDto getTeacherViewByUserAndTvType(@Param("userId") String userId, @Param("tvType") String s, @Param("treeviewId") String treeviewId);

    List <TreeviewStudentDto> inTreeStu(TreeviewUserSearchVo searchVo);

    List<TreeviewStudentDto> noInTreeStu(TreeviewUserSearchVo searchVo);

    Integer noInTreeStuCount(TreeviewUserSearchVo searchVo);

    Integer inTreeStuCount(TreeviewUserSearchVo searchVo);

    Integer noInTreeTeaCount(TreeviewUserSearchVo searchVo);

    List<TreeviewTeacherDto> noInTreeTea(TreeviewUserSearchVo searchVo);

    List<TreeviewTeacherDto> inTreeTea(TreeviewUserSearchVo searchVo);

    Integer inTreeTeaCount(TreeviewUserSearchVo searchVo);

    List<RStudentParentDto> inTreePar(TreeviewUserSearchVo searchVo);

    Integer inTreeParCount(TreeviewUserSearchVo searchVo);

    List<RStudentParentDto> noInTreePar(TreeviewUserSearchVo searchVo);

    Integer noInTreeParCount(TreeviewUserSearchVo searchVo);

    List<SysTreeview> getTeacherTree(String userId);

    void updateSync(String syncFlag);

    @Override
    List<TreeviewUser> queryAll();

    List<TreeviewUser> QueryUserTreeBySyncFlag(String syncFlag);

    void replace(TreeviewUser treeviewUser);

}
